<template>
	<view>
		<u-button class="btns" type="error" @click="to_storage">Storage</u-button>
		<view>
			{{studentname}}
			
			<!-- 452452 -->
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				studentname: '',
			}
		},
		methods: {
			to_storage() {
				let this_=this
				uni.getStorage({
					key: 'student',
					success:function(res) {
						console.log(res.data.age)
						this_.studentname=res.data.age
						//清除存储数据
						uni.removeStorage({
						  key: 'student',//钥匙
						  success: function (res) {
						    console.log('清除存储数据');
						  }
						});
					}
				})
			},



		}
	}
</script>

<style>

</style>
